Last updated: 2024-01-23
Checks: 6 1
Knit directory: UPF1-FMR1/
This reproducible R Markdown analysis was created with workflowr (version 1.7.1). The Checks tab describes the reproducibility checks that were applied when the results were created. The Past versions tab lists the development history.
Great! Since the R Markdown file has been committed to the Git repository, you know the exact version of the code that produced these results.
Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.
The command set.seed(20230923) was run prior to running
the code in the R Markdown file. Setting a seed ensures that any results
that rely on randomness, e.g. subsampling or permutations, are
reproducible.
Great job! Recording the operating system, R version, and package versions is critical for reproducibility.
Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.
Using absolute paths to the files within your workflowr project makes it difficult for you and others to run your code on a different machine. Change the absolute path(s) below to the suggested relative path(s) to make your code more reproducible.
| absolute | relative |
|---|---|
| /home/neuro/Documents/NMD_analysis/Analysis/UPF1-FMR1/data/data-stability-no-FMR1.csv | data/data-stability-no-FMR1.csv |
Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility.
The results in this page were generated with repository version 4c44260. See the Past versions tab to see a history of the changes made to the R Markdown and HTML files.
Note that you need to be careful to ensure that all relevant files for
the analysis have been committed to Git prior to generating the results
(you can use wflow_publish or
wflow_git_commit). workflowr only checks the R Markdown
file, but you know if there are other scripts or data files that it
depends on. Below is the status of the Git repository when the results
were generated:
Ignored files:
Ignored: .Rproj.user/
Ignored: analysis/Exploratory-DEG.nb.html
Ignored: analysis/Quality-control.nb.html
Untracked files:
Untracked: data/data-stability-no-FMR1.csv
Untracked: data/data-stability.csv
Unstaged changes:
Modified: analysis/_site.yml
Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.
These are the previous versions of the repository in which changes were
made to the R Markdown (analysis/RNA-stability.Rmd) and
HTML (docs/RNA-stability.html) files. If you’ve configured
a remote Git repository (see ?wflow_git_remote), click on
the hyperlinks in the table below to view the files as they were in that
past version.
| File | Version | Author | Date | Message |
|---|---|---|---|---|
| Rmd | 4c44260 | urwahnawaz | 2024-01-23 | wflow_publish(c("analysis/RNA-stability.Rmd", "analysis/index.Rmd")) |
| Rmd | 12a58fe | urwahnawaz | 2024-01-22 | wflow_git_commit("./*") |
library(eisaR)
source("code/libraries.R")
source("/home/neuro/Documents/NMD_analysis/other_repos/DiffRAC/DiffRAC.R")
source("code/codes.R")
library(coin)
library(gplots)
library(stargazer)
library(EnsDb.Hsapiens.v86)
library(org.Hs.eg.db)
txdf = transcripts(EnsDb.Hsapiens.v86, return.type="DataFrame")
tx2gene = as.data.frame(txdf[,c("tx_id","gene_id", "tx_biotype")])
sampleTable= read.csv("/home/neuro/Documents/NMD_analysis/Analysis/UPF1-FMR1/data/data-stability-no-FMR1.csv", header=TRUE, sep = ",")
inputFolder="/home/neuro/Documents/NMD_analysis/Analysis/Results/UPF1-FMR1/Stability/quantified/"
salmon.files = ("/home/neuro/Documents/NMD_analysis/Analysis/Results/UPF1-FMR1/Salmon")
salmon = list.files(salmon.files, pattern = "transcripts$", full.names = TRUE)
sample_names = gsub("/home/neuro/Documents/NMD_analysis/Analysis/Results/UPF1-FMR1/Salmon/", "", salmon)
sample_names = gsub(".gz_transcripts", "", sample_names)
sample_names = gsub("\\_.*", "", sample_names)
md = read.csv(here::here("data/Sample_info.csv"), header= TRUE) %>%
#mutate(files = file.path(salmon, "quant.sf")) %>%
dplyr::rename("names" = "GeneWiz.ID",
"Group" = "Sample.type") %>%
mutate(Group = ifelse(Group == "MC" | Group == "FC", "Control", Group)) %>%
dplyr::select(names,everything()) %>%
mutate(names = gsub("\\_.*", "", names) )
md = md[order(match(md$names, sample_names)),]
md %<>% dplyr::filter(Group != "FMR1") %>%
dplyr::filter(names != "23-LDJ6767") %>%
dplyr::filter(names != "202")
de_exonic = DESeqDataSetFromHTSeqCount( # omits special rows from htseq-count
sampleTable = sampleTable[sampleTable$ReadType=="exonic",],
directory = inputFolder,
design = ~ 1 # required parameter
)
countsEx= counts(de_exonic)
de_intron = DESeqDataSetFromHTSeqCount( # omits special rows from htseq-count
sampleTable = sampleTable[sampleTable$ReadType=="intronic",],
directory = inputFolder,
design = ~ 1 # required parameter
)
countsIn = counts(de_intron)
md$Samples = colnames(countsEx)
rownames(md) = md$Samples
countsEx = countsEx[rownames(countsEx) %in% rownames(countsIn),]
countsIn = countsIn[rownames(countsIn) %in% rownames(countsEx),]
diffrac_res <- DiffRAC( ~Group + Sex+ Batch,
md,
countsEx,countsIn,
"sample",
optimizeBias = T)
Initializing DiffRAC framework...
Estimating size factors and dispersions...
Optimizing the bias constant...
0.381966011250105 : 1701754.53572386
0.618033988749895 : 1862941.554938
0.76393202250021 : 1906403.68805911
0.838792542308931 : 1916870.8253327
0.898997746487396 : 1920759.5604013
0.926877442866788 : 1921397.35589651
0.937090887858652 : 1921462.15023998
0.939292836886588 : 1921464.79709878
0.93964305261623 : 1921464.86724234
0.939976399951336 : 1921464.81307705
0.93964305261623 : 1921464.86724234
The bias constant is 0.93964305261623
Re-estimating dispersion...
Fitting model parameters...
res <- as.data.frame(results(diffrac_res$dds,name = "GroupUPF1.Ratio"))
res_sig = res %>% dplyr::filter(padj < 0.05)
res %<>%
rownames_to_column("ensembl_gene_id") %>%
mutate(gene = mapIds(org.Hs.eg.db, keys=ensembl_gene_id, column="SYMBOL",keytype="ENSEMBL", multiVals="first"),
entrez = mapIds(org.Hs.eg.db, keys=ensembl_gene_id, column="ENTREZID",keytype="ENSEMBL", multiVals="first")) %>% drop_na(entrez) %>%
mutate(Expression= ifelse(log2FoldChange > 0 & padj < 0.05, "Upregulated",
ifelse(log2FoldChange < 0 & padj < 0.05, "Downregulated", "Not Sig")))
DEColours <- c("Downregulated" = "#2e294e","Upregulated" = "#720026", "NotSig" = "#E5E5E5")
volc_upf1 = res %>%
mutate(Expression= ifelse(log2FoldChange > 0 & padj < 0.05, "Upregulated",
ifelse(log2FoldChange < 0 & padj < 0.05, "Downregulated", "Not Sig"))) %>%
ggplot(aes(y = -log10(padj),
x = log2FoldChange,
colour = Expression,
size =-log10(padj),
label= gene)) +
geom_point(alpha = 0.8) +
# geom_text(aes(label=ifelse(SYMBOL== "Upf1",as.character(SYMBOL),''))) +
# geom_text(aes(label= SYMBOL), subset = SYMBOL == "Upf1") +
scale_colour_manual(values = DEColours) + theme_classic() +
theme(axis.title.y = element_text(size = 12)) +
geom_hline(yintercept = -log10(0.05), color = "grey60", size = 0.5, lty = "dashed") +
labs(x = "log2 Fold Change", y = "-log10 adj p-value") +
geom_vline(xintercept = 0, size = 0.5, lty = "dashed", color = "grey60") +
xlim(-8.5, 8.5) + ylim(0, 7.5)
# volc = volc_upf1+ geom_text_repel(data=subset(upf1_results_lfc , SYMBOL %in% c("UPF1", "UPF2", "UPF3B",
# "SMG5", "SMG6",
# "UPF3A", "ATF4",
# "GADD5G")),
# aes(label=SYMBOL), position=position_dodge(width = 0.9),
# vjust=-0.40, color = "black", box.padding = 0.5, fill = "white") + ggtitle("DEGs in UPF1 relative to controls using limma/voom")
#
#
# volc
my_gg = volc_upf1 + geom_point_interactive(aes(tooltip =gene, data_id = gene),
size = 1, hover_nearest = TRUE)
girafe(ggobj = my_gg)
Volcano plot showing distribution of differentially stabilized / destabilized genes
res <- as.data.frame(results(diffrac_res$dds,name = "GroupFRAX.Ratio"))
res_sig = res %>% dplyr::filter(padj < 0.05)
res %<>%
rownames_to_column("ensembl_gene_id") %>%
mutate(gene = mapIds(org.Hs.eg.db, keys=ensembl_gene_id, column="SYMBOL",keytype="ENSEMBL", multiVals="first"),
entrez = mapIds(org.Hs.eg.db, keys=ensembl_gene_id, column="ENTREZID",keytype="ENSEMBL", multiVals="first")) %>% drop_na(entrez) %>%
mutate(Expression= ifelse(log2FoldChange > 0 & padj < 0.05, "Upregulated",
ifelse(log2FoldChange < 0 & padj < 0.05, "Downregulated", "Not Sig")))
DEColours <- c("Downregulated" = "#2e294e","Upregulated" = "#720026", "NotSig" = "#E5E5E5")
volc_fmr1 = res %>%
mutate(Expression= ifelse(log2FoldChange > 0 & padj < 0.05, "Upregulated",
ifelse(log2FoldChange < 0 & padj < 0.05, "Downregulated", "Not Sig"))) %>%
ggplot(aes(y = -log10(padj),
x = log2FoldChange,
colour = Expression,
size =-log10(padj),
label= gene)) +
geom_point(alpha = 0.8) +
# geom_text(aes(label=ifelse(SYMBOL== "Upf1",as.character(SYMBOL),''))) +
# geom_text(aes(label= SYMBOL), subset = SYMBOL == "Upf1") +
scale_colour_manual(values = DEColours) + theme_classic() +
theme(axis.title.y = element_text(size = 12)) +
geom_hline(yintercept = -log10(0.05), color = "grey60", size = 0.5, lty = "dashed") +
labs(x = "log2 Fold Change", y = "-log10 adj p-value") +
geom_vline(xintercept = 0, size = 0.5, lty = "dashed", color = "grey60") +
xlim(-8.5, 8.5) + ylim(0, 7.5)
# volc = volc_upf1+ geom_text_repel(data=subset(upf1_results_lfc , SYMBOL %in% c("UPF1", "UPF2", "UPF3B",
# "SMG5", "SMG6",
# "UPF3A", "ATF4",
# "GADD5G")),
# aes(label=SYMBOL), position=position_dodge(width = 0.9),
# vjust=-0.40, color = "black", box.padding = 0.5, fill = "white") + ggtitle("DEGs in UPF1 relative to controls using limma/voom")
#
#
# volc
my_gg = volc_fmr1 + geom_point_interactive(aes(tooltip =gene, data_id = gene),
size = 1, hover_nearest = TRUE)
girafe(ggobj = my_gg)
Volcano plot showing distribution of differentially stabilized / destabilized genes
sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
locale:
[1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_AU.UTF-8 LC_COLLATE=en_AU.UTF-8
[5] LC_MONETARY=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8
[7] LC_PAPER=en_AU.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C
time zone: Australia/Adelaide
tzcode source: system (glibc)
attached base packages:
[1] grid stats4 tools stats graphics grDevices utils
[8] datasets methods base
other attached packages:
[1] plyr_1.8.9 org.Hs.eg.db_3.18.0
[3] EnsDb.Hsapiens.v86_2.99.0 stargazer_5.2.3
[5] gplots_3.1.3 coin_1.4-3
[7] survival_3.5-7 ngsReports_2.4.0
[9] patchwork_1.2.0 AnnotationHub_3.10.0
[11] BiocFileCache_2.10.1 dbplyr_2.4.0
[13] openxlsx_4.2.5.2 ggiraph_0.8.8
[15] DT_0.31 msigdb_1.10.0
[17] GSEABase_1.64.0 graph_1.80.0
[19] annotate_1.80.0 XML_3.99-0.16
[21] pheatmap_1.0.12 ggvenn_0.1.10
[23] MetBrewer_0.2.0 ggpubr_0.6.0
[25] venn_1.12 viridis_0.6.4
[27] viridisLite_0.4.2 tximeta_1.20.2
[29] tximport_1.30.0 goseq_1.54.0
[31] geneLenDataBase_1.38.0 BiasedUrn_2.0.11
[33] org.Mm.eg.db_3.18.0 EnsDb.Mmusculus.v79_2.99.0
[35] ensembldb_2.26.0 AnnotationFilter_1.26.0
[37] GenomicFeatures_1.54.1 AnnotationDbi_1.64.1
[39] biomaRt_2.58.0 edgeR_4.0.11
[41] limma_3.58.1 DESeq2_1.42.0
[43] SummarizedExperiment_1.32.0 Biobase_2.62.0
[45] MatrixGenerics_1.14.0 matrixStats_1.2.0
[47] GenomicRanges_1.54.1 GenomeInfoDb_1.38.5
[49] IRanges_2.36.0 S4Vectors_0.40.2
[51] BiocGenerics_0.48.1 corrplot_0.92
[53] lubridate_1.9.3 forcats_1.0.0
[55] purrr_1.0.2 readr_2.1.5
[57] tidyverse_2.0.0 stringr_1.5.1
[59] tidyr_1.3.0 scales_1.3.0
[61] data.table_1.14.10 readxl_1.4.3
[63] tibble_3.2.1 magrittr_2.0.3
[65] reshape2_1.4.4 ggplot2_3.4.4
[67] dplyr_1.1.4 eisaR_1.14.1
[69] workflowr_1.7.1
loaded via a namespace (and not attached):
[1] fs_1.6.3 ProtGenerics_1.34.0
[3] bitops_1.0-7 httr_1.4.7
[5] RColorBrewer_1.1-3 backports_1.4.1
[7] utf8_1.2.4 R6_2.5.1
[9] lazyeval_0.2.2 mgcv_1.9-1
[11] withr_3.0.0 prettyunits_1.2.0
[13] gridExtra_2.3 cli_3.6.2
[15] sandwich_3.1-0 labeling_0.4.3
[17] sass_0.4.8 mvtnorm_1.2-4
[19] Rsamtools_2.18.0 systemfonts_1.0.5
[21] rstudioapi_0.15.0 RSQLite_2.3.5
[23] generics_0.1.3 BiocIO_1.12.0
[25] gtools_3.9.5 car_3.1-2
[27] zip_2.3.0 GO.db_3.18.0
[29] Matrix_1.6-5 fansi_1.0.6
[31] abind_1.4-5 lifecycle_1.0.4
[33] whisker_0.4.1 multcomp_1.4-25
[35] yaml_2.3.8 carData_3.0-5
[37] SparseArray_1.2.3 blob_1.2.4
[39] promises_1.2.1 crayon_1.5.2
[41] lattice_0.22-5 KEGGREST_1.42.0
[43] pillar_1.9.0 knitr_1.45
[45] rjson_0.2.21 admisc_0.34
[47] codetools_0.2-19 glue_1.7.0
[49] getPass_0.2-4 vctrs_0.6.5
[51] png_0.1-8 cellranger_1.1.0
[53] gtable_0.3.4 cachem_1.0.8
[55] xfun_0.41 S4Arrays_1.2.0
[57] mime_0.12 libcoin_1.0-10
[59] statmod_1.5.0 interactiveDisplayBase_1.40.0
[61] ellipsis_0.3.2 TH.data_1.1-2
[63] nlme_3.1-164 bit64_4.0.5
[65] progress_1.2.3 filelock_1.0.3
[67] rprojroot_2.0.4 bslib_0.6.1
[69] KernSmooth_2.23-22 colorspace_2.1-0
[71] DBI_1.2.1 tidyselect_1.2.0
[73] processx_3.8.3 bit_4.0.5
[75] compiler_4.3.2 curl_5.2.0
[77] git2r_0.33.0 xml2_1.3.6
[79] ggdendro_0.1.23 DelayedArray_0.28.0
[81] plotly_4.10.4 rtracklayer_1.62.0
[83] caTools_1.18.2 callr_3.7.3
[85] rappdirs_0.3.3 digest_0.6.34
[87] rmarkdown_2.25 XVector_0.42.0
[89] htmltools_0.5.7 pkgconfig_2.0.3
[91] highr_0.10 fastmap_1.1.1
[93] rlang_1.1.3 htmlwidgets_1.6.4
[95] shiny_1.8.0 farver_2.1.1
[97] jquerylib_0.1.4 zoo_1.8-12
[99] jsonlite_1.8.8 BiocParallel_1.36.0
[101] RCurl_1.98-1.14 modeltools_0.2-23
[103] GenomeInfoDbData_1.2.11 munsell_0.5.0
[105] Rcpp_1.0.12 stringi_1.8.3
[107] zlibbioc_1.48.0 MASS_7.3-60.0.1
[109] parallel_4.3.2 Biostrings_2.70.1
[111] splines_4.3.2 pander_0.6.5
[113] hms_1.1.3 locfit_1.5-9.8
[115] ps_1.7.6 uuid_1.2-0
[117] ggsignif_0.6.4 BiocVersion_3.18.1
[119] evaluate_0.23 BiocManager_1.30.22
[121] tzdb_0.4.0 httpuv_1.6.13
[123] broom_1.0.5 xtable_1.8-4
[125] restfulr_0.0.15 rstatix_0.7.2
[127] later_1.3.2 memoise_2.0.1
[129] GenomicAlignments_1.38.2 timechange_0.3.0
[131] here_1.0.1